@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    --transition: 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    --blur: blur(24px);
    --icon-color: none;
    --icon-p-b-size: 32px;
    --icon-size: 24px;
    --icon-margin: 4px;
    --item-height: 24px;
    --item-icon: 24px;
    --item-icon-margin: 0;
    --zest-index: 0;
    --x-x-bar-w: 16px;
    --x-x-handle-d: block;
    --x-x-handle-w: 8px;
    --x-x-handle-o: calc(50% - var(--x-x-handle-w) / 2);
    --x-x-handle-o2: calc(-0.5 * var(--x-x-handle-w));
    --zoom: 1;
    --bg-color1: rgba(225, 225, 225, 0.8);
    --bg-color2: rgba(255, 255, 255, 0.72);
    --bg-color3: #ddd;
    --bg-color4: #f5f5f5;
    --bg-color5: rgba(136, 136, 136, 0.2);
    --color5: #eee;
    --color6: #000;
    --shadow1: 0 0 4px #3333;
    --bg1: #ffffff;
    --main-color: #0860f2;
    --main-font-color: #fff;
    --icon-color: none;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: #ddd;
}
::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}
::-webkit-scrollbar-track {
    background: #0000;
}
::-webkit-scrollbar-button {
    border-radius: 10px;
    height: 8px;
    width: 8px;
    background-color: #ddd;
}
::-webkit-scrollbar-corner {
    background-color: #0000;
}

.icon {
    position: absolute;
    pointer-events: none;
    left: 0;
    top: 0;
    filter: var(--icon-color);
    user-select: none;
    -webkit-user-drag: none;
}

.icon-pel > div {
    @apply icon-m flex-shrink-0;
}
.icon-m {
    @apply h-8 w-8 relative cursor-pointer;
}
.icon-m > .icon {
    @apply h-6 w-6 top-1 left-1;
}

.hide_scrool_bar::-webkit-scrollbar {
    display: none;
}
.hide_scrool_bar {
    scrollbar-width: none;
}

.checkbox {
    appearance: none;
    width: 1em;
    height: 1em;
    margin-inline-end: 0.4em;
    border: 2px #888 solid;
    cursor: pointer;
    border-radius: 0.25em;
}
.checkbox:checked {
    background-color: var(--main-color);
    border: 2px var(--main-color) solid;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 8 9 19 4 14'%3E%3C/polyline%3E%3C/svg%3E");
    background-position: center;
    background-size: 0.75em auto;
    background-repeat: no-repeat;
}

html {
    height: 100%;
    @apply fixed top-0 left-0;
}

body {
    margin: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
    color: var(--color6);
    font-family: sans-serif, misansl3;
}

input,
textarea,
select {
    outline: none;
    border: none;
    background-color: transparent;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
}

input[type="checkbox"] {
    @apply checkbox;
}

.bar {
    background-color: var(--bg-color2);
    backdrop-filter: var(--blur);
}

.dialog {
    @apply flex fixed top-0 left-0 w-screen z-50 items-center justify-center;
    height: 100dvh;
}

.dialog > div {
    @apply w-80;
}
.prompt > div {
    @apply grid bar gap-2 p-3 rounded-lg;
    box-shadow: var(--shadow1);
}
.prompt > div > :nth-child(1) {
    grid-area: 1 / 1 / 2 / 3;
    @apply text-center;
}
.prompt > div > :nth-child(2) {
    grid-area: 2 / 1 / 3 / 3;
    background-color: var(--bg-color1);
    @apply rounded-md p-2 w-full;
    outline: 2px solid var(--main-color);
    caret-color: var(--main-color);
}
.prompt > div > :nth-child(3) {
    grid-area: 3 / 1 / 4 / 2;
    background-color: var(--bg-color1);
    @apply rounded-full text-center p-2 cursor-pointer;
}
.prompt > div > :nth-child(4) {
    grid-area: 3 / 2 / 4 / 3;
    background-color: var(--main-color);
    color: var(--main-font-color);
    @apply rounded-full text-center p-2 cursor-pointer;
}
.confirm > div {
    @apply grid bar gap-2 p-3 rounded-lg;
    box-shadow: var(--shadow1);
}
.confirm > div > :nth-child(1) {
    grid-area: 1 / 1 / 2 / 3;
}
.confirm > div > :nth-child(2) {
    grid-area: 2 / 1 / 3 / 2;
    background-color: var(--bg-color1);
    @apply rounded-full text-center p-2 cursor-pointer;
}
.confirm > div > :nth-child(3) {
    grid-area: 2 / 2 / 3 / 3;
    background-color: var(--main-color);
    color: var(--main-font-color);
    @apply rounded-full text-center p-2 cursor-pointer;
}

body > #main {
    height: 100%;
    display: grid;
    grid-template-rows: min-content auto;
}

body > #main > #nav {
    position: relative;
    z-index: 2;
    grid-area: 1 / 1 / 2 / 2;
    width: 100vw;
    display: grid;
    justify-content: start;
    background-color: var(--bg1);
}
body > #main > #nav > div {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    height: var(--icon-p-b-size);
}
body > #main > #nav > :nth-child(1) {
    grid-area: 1 / 1 / 2 / 2;
}
body > #main > #nav > #mode_bar {
    grid-area: 1 / 2 / 2 / 3;
}
body > #main > #nav > .mode_more {
    grid-area: 1 / 3 / 2 / 4;
}
.模式突出 {
    background-color: var(--bg-color1);
}
body > #main > #nav > div::-webkit-scrollbar {
    display: none;
}
body > #main > #nav > div:not(.mode_more) > div {
    @apply icon-m;
}
body > #main > #nav > div:nth-child(1) #upload_i {
    display: none;
}

body > #main > #nav > .mode_more > div {
    @apply flex w-auto;
}
body > #main > #nav > .mode_more > div > div {
    @apply icon-m;
}
body > #main > #nav > #draw_bar {
    touch-action: none;
}

#color_yl {
    left: var(--icon-margin);
    top: var(--icon-margin);
    width: var(--icon-size);
    height: var(--icon-size);
    position: relative;
    box-sizing: border-box;
    border-radius: 50%;
    border: var(--bg1) 2px solid;
    box-shadow: var(--shadow1);
}
#penc {
    top: 0;
    position: absolute;
    border: none;
}
x-color {
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    top: var(--icon-p-b-size);
    position: absolute;
    padding: 8px;
    border-radius: 8px;
}
.color_show {
    opacity: 1;
    pointer-events: all;
}
x-color {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: auto;
    background-color: var(--bg-color2);
    box-shadow: var(--shadow1);
    backdrop-filter: var(--blur);
}
x-color > .broad {
    width: 300px;
    height: 300px;
    position: relative;
    cursor: crosshair;
}
x-color > .broad > div {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    overflow: hidden;
}
x-color > .broad .color_pointer {
    width: 8px;
    height: 8px;
    position: absolute;
    transform: translateX(-50%) translateY(-50%);
    border: 1px solid;
    outline: 1px solid white;
    pointer-events: none;
}
x-color > .range {
    position: relative;
    height: 20px;
    cursor: ew-resize;
}
x-color > .range > .color_range_p {
    width: 2px;
    height: 100%;
    position: absolute;
    transform: translateX(-50%);
    outline: 1px solid;
    pointer-events: none;
}
x-color > div:nth-child(2) {
    background: linear-gradient(to right, red 0%, #ff0 17%, lime 33%, cyan 50%, blue 66%, #f0f 83%, red 100%);
}
x-color > .color_bar {
    height: 20px;
    display: flex;
    overflow: auto;
    gap: 4px;
}
x-color > .color_bar > input {
    width: 6em;
}
x-color > .color_bar > div {
    height: 20px;
    width: 20px;
    border-radius: 4px;
    cursor: pointer;
}
x-color > .color_bar > div:nth-child(2) {
    width: auto;
    outline: none;
    display: flex;
    align-items: flex-end;
    user-select: none;
}

#笔 {
    position: relative;
}
#笔 > div {
    position: absolute;
    width: 300px;
    top: var(--icon-p-b-size);
    user-select: none;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    border-radius: 8px;
    padding: 4px;
    background-color: var(--bg-color2);
    backdrop-filter: var(--blur);
    box-shadow: var(--shadow1);
}
.pen_show {
    opacity: 1 !important;
    pointer-events: all !important;
}
x-draw-width > div {
    height: 20px;
    width: 80%;
    margin: 0 auto;
    position: relative;
}
x-draw-width > div > div {
    pointer-events: none;
    position: absolute;
    top: 10px;
    transform: translateX(-50%) translateY(-50%);
    border-radius: 50%;
    background-color: #000;
    border: 2px var(--bg1) solid;
    box-shadow: var(--shadow1);
}

body > #main > #nav #切换侧栏 {
    display: none;
}
body #main > #nav #ink {
    width: 100vw;
    height: calc(100dvh - var(--icon-p-b-size));
    position: fixed;
    top: var(--icon-p-b-size);
    left: 0;
    background-color: #0000000e;
}
body #main > #nav #ink_icon {
    min-width: 2rem;
}
body #main > #nav #ink_r {
    @apply flex w-full gap-1 items-center;
}
.ink_hide {
    pointer-events: none;
    opacity: 0;
}

.db_load {
    display: none;
}

.侧栏 {
    display: flex;
    overflow: hidden;
    position: fixed;
    left: 0;
    top: var(--icon-p-b-size);
    height: calc(100dvh - var(--icon-p-b-size));
    background-color: var(--bg-color2);
    backdrop-filter: var(--blur);
    transition: var(--transition) transform;
    z-index: 2;
}
.侧栏显示 {
    transform: translateX(0%);
    box-shadow: var(--shadow1) !important;
}

.侧栏 > #handle {
    touch-action: none;
}

.侧栏 > #tabs {
    width: var(--icon-p-b-size);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(60px);
    border-radius: 4px;
}

.侧栏 > #items {
    flex-grow: 1;
    overflow: hidden;
    width: 300px;
    transition: var(--transition);
}
.侧栏 > #items > * {
    width: 300px;
}

.selected_item {
    background-color: var(--bg-color5);
    border-radius: 4px;
    backdrop-filter: var(--blur);
}
.selected_item_hide {
    background-color: transparent;
}
.item_hide {
    width: 0 !important;
}
.selected_item2 {
    color: var(--main-color);
}

.侧栏 > #items > div:nth-child(1) {
    height: 100%;
}
.侧栏 > #items > div:not(:nth-child(1)) {
    height: 0;
}

.侧栏 > #items > div {
    overflow: auto;
}

.侧栏 > #items > #文件 > div:nth-child(1) {
    min-height: var(--icon-p-b-size);
    position: relative;
    cursor: pointer;
}
.侧栏 > #items > #文件 > div:nth-child(1) > .icon {
    height: var(--icon-size);
    width: var(--icon-size);
    top: var(--icon-margin);
    left: calc(50% - var(--icon-size) / 2);
}
.侧栏 > #items > #文件 > div {
    display: flex;
    width: calc(100% - 8px);
    align-items: center;
    height: var(--item-height);
}
.侧栏 > #items > #文件 > div > div {
    width: var(--item-height);
    height: var(--item-height);
    position: relative;
    cursor: pointer;
}
.侧栏 > #items > #文件 > div > :last-child {
    width: auto;
}
.侧栏 > #items > #文件 > div > div > .icon {
    width: var(--item-icon);
    height: var(--item-icon);
    left: var(--item-icon-margin);
    top: var(--item-icon-margin);
}
.侧栏 > #items > #文件 > div > a {
    flex-grow: 1;
    box-sizing: border-box;
}

.more {
    @apply inline-flex justify-end overflow-hidden opacity-0 w-min align-bottom;
}
.侧栏 > #items > #文件 > div:hover .more {
    @apply opacity-100;
}
.more > div {
    min-width: var(--item-height);
    height: var(--item-height);
    position: relative;
    cursor: pointer;
}
.more > div > .icon {
    width: var(--item-icon);
    height: var(--item-icon);
    left: var(--item-icon-margin);
    top: var(--item-icon-margin);
}

.show_more {
    width: auto !important;
}

.侧栏 > #items > #层容器 {
    display: flex;
    flex-direction: column;
    @apply overflow-hidden;
}
.侧栏 > #items > #层容器 > div:nth-child(1) {
    top: 0;
    min-height: var(--icon-p-b-size);
    overflow-x: auto;
    background-color: var(--bg1);
}

.侧栏 > #items > #层容器 > div:nth-child(2) {
    background-color: var(--bg1);
}
#xywh > input {
    width: 25%;
}
#el_style > :not(:last-child) {
    @apply font-mono;
}
#el_style > :not(:last-child) > input {
    min-width: 1em;
    @apply inline-block align-bottom outline-none;
}
#el_style > :not(:last-child) > :nth-child(2) {
    color: var(--main-color);
}
#el_style > :last-child:not(textarea) {
    @apply relative h-4;
}
#el_style > :last-child > .icon {
    @apply w-4 h-4;
}
#el_style > textarea {
    @apply w-full h-40;
}
#switch_global_style {
    @apply relative h-4;
}
#switch_global_style > .icon {
    @apply w-4 h-4;
}
#style_com_list {
    @apply absolute bar max-h-36 max-w-full overflow-auto px-1 rounded-sm;
    box-shadow: var(--shadow1);
}
#style_com_list > div {
    @apply whitespace-nowrap;
}
#style_com_list > div > span > span {
    @apply font-medium;
}
.style_color {
    @apply inline-block w-4 h-4 rounded;
}
.style_com_list_hide {
    @apply opacity-0 pointer-events-none;
}
.层容器 > #层 {
    @apply overflow-auto;
}
.层容器 > #层 ul {
    list-style: none;
    padding-inline-start: 24px;
    position: relative;
}
.层容器 > #层 ul::before {
    content: "";
    width: 1px;
    height: 100%;
    position: absolute;
    left: -12px;
    background-color: var(--color6);
}
.层容器 > #层 > ul::before {
    display: none;
}
.层容器 > #层 > ul > li > span {
    @apply flex sticky top-0 bar z-10;
}
.层容器 > #层 > ul > li > span > span {
    @apply flex-grow;
}
.层容器 > #层 > ul > li > span:hover > .more {
    opacity: 1;
}
.画布focus > span > span {
    color: var(--main-color);
}
.层容器 > #层 li {
    position: relative;
}
.层容器 > #层 li > img {
    @apply absolute w-4 h-4 -left-5 top-1;
    transition: var(--transition);
    filter: var(--icon-color);
}
.层容器 > #层 li > span {
    @apply inline-block h-6;
}
.层容器 > #层 > ul > li li > span {
    width: calc(100% - 16px - 4px - 0.4rem - 1rem);
}
.层容器 > #层 li > input[type="checkbox"] {
    @apply checkbox;
}
.层ul_hide > ul {
    display: none;
}
.层ul_hide > img {
    @apply -rotate-90;
}
.层容器 > textarea {
    outline: none;
    border: none;
}

.侧栏 > #items > #工具 > div {
    @apply float-left;
}

.侧栏 #ys_add {
    @apply relative cursor-pointer;
    height: var(--icon-p-b-size);
}
.侧栏 #ys_add > .icon {
    height: var(--icon-size);
    width: var(--icon-size);
    top: var(--icon-margin);
    left: calc(50% - var(--icon-size) / 2);
}

.侧栏 #ys_list > div {
    @apply flex;
}
.侧栏 #ys_list > div > .ys_tran {
    width: calc(100% - var(--icon-p-b-size) * 3);
}
.侧栏 #ys_list > div > div {
    @apply icon-m;
}

.侧栏 > #items > #中转站 {
    display: flex;
    flex-direction: column;
}
.侧栏 > #items > #中转站 > #常驻 {
    display: flex;
    flex-wrap: wrap;
}
.侧栏 > #items > #中转站 > #临时 {
    flex-grow: 1;
    overflow-y: auto;
}
.侧栏 > #items > #中转站 > #临时 > div {
    margin-top: 16px;
    position: relative;
}
.侧栏 > #items > #中转站 > #临时 > div > x-x {
    position: static !important;
}
.侧栏 > #items > #中转站 > #临时 .x-x_bar {
    opacity: 1;
    pointer-events: all;
}
.侧栏 > #items > #中转站 > #临时 .x-x_bar > div:nth-child(3) {
    display: block;
}
.侧栏 > #items > #中转站 > #临时 .x-x_bar > div:nth-child(4) {
    display: none;
}
.侧栏 > #items > #资源 {
    @apply flex flex-col gap-1;
}
.侧栏 > #items > #资源 > div {
    @apply relative;
}
.侧栏 > #items > #资源 > div > div {
    position: absolute;
    right: 4px;
    top: 4px;
    @apply flex gap-1 z-50;
}
.侧栏 > #items > #资源 > div > div > :nth-child(1),
.侧栏 > #items > #资源 > div > div > :nth-child(2) {
    @apply w-auto text-xs;
}
.侧栏 > #items > #资源 .assets_goto {
    @apply w-auto overflow-auto flex;
    max-width: 3rem;
}
.侧栏 > #items > #资源 .assets_goto > div {
    @apply w-4 h-4 rounded;
    transition: var(--transition);
}
.侧栏 > #items > #资源 .assets_goto > div:hover {
    background-color: var(--bg-color1);
}
.侧栏 > #items > #资源 > div > div > div {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background-color: var(--bg-color2);
    backdrop-filter: var(--blur);
}
.侧栏 > #items > #资源 x-img > div {
    @apply hidden;
}
.not_click {
    @apply opacity-50 cursor-not-allowed pointer-events-none;
}

.侧栏 > #items > #值 > textarea {
    height: 40%;
}
.侧栏 > #items > #设置 > form > fieldset > input {
    width: 100%;
}
.侧栏 > #items > #设置 > *:not(:last-child) {
    @apply m-4;
}
.侧栏 > #items > #设置 > div:last-child {
    display: flex;
    position: sticky;
    bottom: 0;
    justify-content: center;
    background-color: var(--bg-color2);
    backdrop-filter: var(--blur);
}
.侧栏 > #items > #设置 > div:last-child > div {
    @apply icon-m;
}

.侧栏 > #items > #设置 > #about > div {
    text-align: center;
}

.侧栏 > #items > #设置 > #about > #version > img {
    @apply w-4 h-4;
}
.password {
    color: transparent;
}
.password:focus {
    color: inherit;
}

.buttom_a {
    background-color: var(--bg-color3) !important;
}
body > #main > #画布 {
    flex-grow: 1;
    position: relative;
    grid-area: 2 / 1 / 3 / 2;
    touch-action: none;
    contain: paint;
    background-color: var(--bg1);
}

/* 画布 */
body > #main > #画布 > #画布们 {
    position: relative;
    background-color: var(--bg1);
}
body > #main > #画布 > #画布们 > div {
    @apply absolute top-0 left-0 w-0 h-0;
    transition-timing-function: cubic-bezier(0.65, 0.05, 0.36, 1);
}
body > #main > .浏览 .x-x_bar {
    @apply hidden;
}

body > #main > .设计 * {
    user-select: none;
}

body > #main > .绘制 > * {
    pointer-events: none;
    user-select: none;
}
body > #main > #画布 > #选择框 {
    position: absolute;
    top: 0;
    left: 0;
}
body > #main > #画布 > #选择框 > div {
    position: absolute;
    border: 1px solid #000;
}
body > #main > #画布 > #选择框 > canvas {
    width: 100%;
    height: 100%;
}
body > #main > #画布 > #选择 {
    position: absolute;
    top: 0;
    left: 0;
}
body > #main > #画布 > #选择 > div {
    position: absolute;
    display: var(--x-x-handle-d);
    pointer-events: none;
}
.xxhandle > div:not(.x-x_bar) {
    pointer-events: all;
    position: absolute;
    width: var(--x-x-handle-w);
    height: var(--x-x-handle-w);
    border-radius: 50%;
}

.x-x_selected {
    border: 1px dashed var(--main-color) !important;
}
.x-x_hover > div {
    border: 1px solid var(--main-color);
    background-color: var(--bg1);
}
.x-x_hover {
    border: 1px dashed var(--color6);
}
.xxhandle > div:hover {
    background-color: var(--main-color);
}
.xxhandle > .xxhandle0 {
    left: var(--x-x-handle-o);
    top: var(--x-x-handle-o2);
}
.xxhandle > .xxhandle1 {
    top: var(--x-x-handle-o);
    right: var(--x-x-handle-o2);
}
.xxhandle > .xxhandle2 {
    left: var(--x-x-handle-o);
    bottom: var(--x-x-handle-o2);
}
.xxhandle > .xxhandle3 {
    top: var(--x-x-handle-o);
    left: var(--x-x-handle-o2);
}
.xxhandle > .xxhandle4 {
    right: var(--x-x-handle-o2);
    top: var(--x-x-handle-o2);
}
.xxhandle > .xxhandle5 {
    right: var(--x-x-handle-o2);
    bottom: var(--x-x-handle-o2);
}
.xxhandle > .xxhandle6 {
    bottom: var(--x-x-handle-o2);
    left: var(--x-x-handle-o2);
}
.xxhandle > .xxhandle7 {
    left: var(--x-x-handle-o2);
    top: var(--x-x-handle-o2);
}

.设计 .xxhandle > .xxhandle0,
.绘制 .xxhandle > .xxhandle0 {
    cursor: n-resize;
}
.设计 .xxhandle > .xxhandle1,
.绘制 .xxhandle > .xxhandle1 {
    cursor: e-resize;
}
.设计 .xxhandle > .xxhandle2,
.绘制 .xxhandle > .xxhandle2 {
    cursor: s-resize;
}
.设计 .xxhandle > .xxhandle3,
.绘制 .xxhandle > .xxhandle3 {
    cursor: w-resize;
}
.设计 .xxhandle > .xxhandle4,
.绘制 .xxhandle > .xxhandle4 {
    cursor: ne-resize;
}
.设计 .xxhandle > .xxhandle5,
.绘制 .xxhandle > .xxhandle5 {
    cursor: se-resize;
}
.设计 .xxhandle > .xxhandle6,
.绘制 .xxhandle > .xxhandle6 {
    cursor: sw-resize;
}
.设计 .xxhandle > .xxhandle7,
.绘制 .xxhandle > .xxhandle7 {
    cursor: nw-resize;
}

/* 导航 */

#画布 > #导航 {
    color: var(--bg1);
}
body > #main > #画布 > #导航 > div {
    @apply w-4 h-4 rounded-lg bg-gray-100 dark:bg-zinc-500;
    cursor: pointer;
    position: relative;
}
body > #main > #画布 > #导航 > div > .icon {
    @apply w-4 h-4;
}
body > #main > #画布 > #导航 > #缩放 {
    width: auto !important;
    font-size: small;
}
.zoom_list_hide {
    opacity: 0;
    pointer-events: none;
}
body > #main > #画布 > #导航 > #缩放 > #zooms > :nth-child(1) {
    @apply relative h-4;
}
body > #main > #画布 > #导航 > #缩放 > #zooms > :nth-child(1) > .icon {
    @apply h-4;
}
body > #main > #画布 > #导航 #mini_map_p {
    @apply absolute right-0 bar p-1 rounded overflow-auto box-content;
    max-height: 300px;
    max-width: 300px;
    bottom: calc(100% + 4px);
}
.mini_map_hide {
    display: none;
}
body > #main > #画布 > #paste {
    opacity: 0;
    pointer-events: none;
}

body > #main > #画布 > x-link-value {
    position: fixed;
    transition: opacity var(--transition);
    cursor: pointer !important;
    @apply flex flex-col-reverse gap-1;
}
body > #main > #画布 > x-link-value > div {
    background-color: var(--bg-color2);
    backdrop-filter: var(--blur);
    border-radius: 4px;
    box-shadow: var(--shadow1);
}
body > #main > #画布 > x-link-value > div:nth-child(1) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
body > #main > #画布 > x-link-value > div > img {
    width: 16px;
    height: 16px;
    margin: 4px;
}
body > #main > #画布 > x-link-value > div:nth-child(1) > div:nth-child(2) {
    padding: 0 0.5em;
}
.hide_link_ctrl > div:nth-child(1) > img {
    display: none;
}
body > #main > #画布 > x-link-value > div:nth-child(2) {
    margin-top: 4px;
}
body > #main > #画布 > x-link-value > div:nth-child(2) > div {
    @apply flex items-center;
}
body > #main > #画布 > x-link-value > div:nth-child(2) > div > div:not(:first-child) {
    width: 16px;
    height: 16px;
    position: relative;
}
body > #main > #画布 > x-link-value > div:nth-child(2) > div > div > .icon {
    width: 16px;
    height: 16px;
}
body > #main > #画布 > #菜单 {
    @apply absolute bar rounded;
    box-shadow: var(--shadow1);
    transition: opacity var(--transition);
}
body > #main > #画布 > #菜单 > div {
    @apply flex items-center gap-1 text-sm px-1;
    transition: var(--transition);
}
body > #main > #画布 > #菜单 > div:hover {
    background-color: var(--bg-color5);
}
body > #main > #画布 > #菜单 > div > .icon {
    @apply w-4 h-4 static;
}
.menu_hide {
    @apply opacity-0 pointer-events-none;
}

x-link-add {
    @apply inline-block w-2 h-2 rounded;
    background-color: var(--bg-color1);
}

.breadcrumbs {
    @apply absolute overflow-auto flex bg-white dark:bg-black transition-all gap-2;
    top: var(--icon-p-b-size);
    left: var(--icon-p-b-size);
    width: calc(100vw - var(--icon-p-b-size));
    height: 0;
}

.bci {
    @apply text-xs whitespace-pre;
}

body > #搜索 {
    position: absolute;
    top: 30vh;
    left: calc(50% - 30vw);
    width: 60vw;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    background-color: var(--bg-color2);
    backdrop-filter: var(--blur);
    box-shadow: var(--shadow1);
    border-radius: 4px;
    box-sizing: border-box;
    z-index: 3;
    @apply flex flex-col-reverse overflow-hidden;
}
.搜索展示 {
    opacity: 1 !important;
    pointer-events: all !important;
}
body > #搜索[data-fid="0"] {
    @apply flex-col;
}
body > #搜索[data-fid="0"] > #更多结果 {
    top: 24px;
}
body > #搜索 > input {
    width: 100%;
    padding-left: 4px;
}
body > #搜索 > #搜索结果 {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 50vh;
}
body > #搜索 > #搜索结果 > div {
    @apply search_r;
}
.search_r {
    @apply relative;
}
.search_r > div {
    position: absolute;
    width: calc(100% - 8px);
    margin: 4px;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
    height: 32px;
    @apply overflow-hidden;
}
.search_r > div > div:last-child {
    position: absolute;
    right: 0;
    top: 0;
}
.search_r > div > div > span > span {
    color: #f55;
}
body > #搜索 > #更多结果 {
    overflow: auto;
    top: 0;
    height: calc(100% - 24px);
    width: 100%;
    transition: var(--transition);
    @apply absolute bar;
}
body > #搜索 > #更多结果 > div {
    @apply search_r;
}
.search_more_hide {
    transform: translateX(100%);
}
.search_item_select {
    background-color: var(--bg-color5);
    backdrop-filter: var(--blur);
}

body > #viewer {
    @apply absolute pointer-events-none overflow-hidden;
    background-color: var(--bg-color2);
    backdrop-filter: var(--blur);
    box-shadow: var(--shadow1);
    border-radius: 4px;
    z-index: 4;
}

.viewer_hide {
    opacity: 0;
}
body > #viewer > #viewer_children {
    @apply relative origin-top-left;
    transition: opacity var(--transition);
}
body > #viewer > #viewer_highlight {
    @apply absolute transition-all;
    border: 1px dashed var(--main-color);
}
body > #tips {
    position: fixed;
    top: 4rem;
    left: 50%;
    transform: translateX(-50%);
    transition: var(--transition);
    z-index: 6;
    @apply flex flex-col gap-1;
}
#tips > * {
    background-color: var(--bg-color2);
    backdrop-filter: var(--blur);
    border-radius: 4px;
    box-shadow: var(--shadow1);
}

body > #toast {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    padding: 4px;
    background-color: var(--bg-color2);
    backdrop-filter: var(--blur);
    border-radius: 4px;
    box-shadow: var(--shadow1);
    transition: var(--transition);
    z-index: 6;
    @apply flex items-center gap-1;
}

.toast_show {
    opacity: 1 !important;
    pointer-events: all !important;
}
body > #toast progress {
    @apply appearance-none h-2 border-none rounded-full overflow-hidden block w-32;
    background-color: var(--bg-color3);
}
body > #toast progress::-moz-progress-bar {
    background-color: var(--color6);
    @apply rounded-full;
}
body > #toast progress::-webkit-progress-bar {
    @apply rounded-full;
    background: none;
}
body > #toast progress[value]::-webkit-progress-value {
    background-color: var(--color6);
}
body > #toast > div {
    @apply relative w-5 h-5 rounded-sm;
    transition: var(--transition);
}
body > #toast > div:hover {
    background-color: var(--bg-color5);
}
body > #toast > div > .icon {
    @apply w-4 h-4;
    left: 2px;
    top: 2px;
}

x-sinppet {
    float: left;
    overflow: auto;
}
x-sinppet > div {
    @apply flex flex-wrap gap-1;
    filter: var(--icon-color);
}
x-sinppet > div > img:hover {
    background-color: var(--bg-color1);
}

.add_tag {
    position: absolute;
    outline: none;
    padding: 0;
    border: none;
    background-color: var(--bg-color2);
    backdrop-filter: var(--blur);
    border-radius: 4px;
    box-shadow: var(--shadow1);
}

x-x {
    position: absolute;
    display: block;
    width: max-content;
    min-width: 1em;
}

.x-x_bar_show,
.x-x_bar_show2 {
    opacity: 1 !important;
    pointer-events: all !important;
}

x-x > * {
    margin: 0;
    outline: none;
}

.x-x_bar {
    display: flex;
    position: absolute;
    top: calc(-1 * var(--x-x-bar-w));
    left: 0;
    transition: opacity var(--transition);
    cursor: pointer !important;
    gap: 4px;
}
.x-x_bar > div {
    width: var(--x-x-bar-w);
    height: var(--x-x-bar-w);
    position: relative;
    background-color: var(--bg-color2);
    backdrop-filter: var(--blur);
    border-radius: 4px;
    box-shadow: var(--shadow1);
}
.x-x_bar > div > .icon {
    width: var(--x-x-bar-w);
    height: var(--x-x-bar-w);
}
.x-x_bar > div:nth-child(3) {
    display: none;
}

x-x:focus-within {
    z-index: calc(var(--z) + 1) !important;
}
body > #main > #画布 > #画布们 > div > x-x:focus-within {
    z-index: calc(var(--zest-index) + 1) !important;
}
.设计 x-x,
.绘制 x-x {
    cursor: move;
}

.拖拽 .xxhandle {
    display: none !important;
}
.free_drag_tip {
    background-color: #000;
    position: fixed;
}

x-link-arrow {
    @apply pointer-events-none;
}
x-link-arrow > svg {
    overflow: initial;
    @apply pointer-events-none;
}
x-link-arrow > svg > path {
    fill: none;
    @apply pointer-events-auto;
}
.link_arrow_p {
    @apply pointer-events-none;
}
x-md {
    position: relative;
    display: block;
}

body > #main > #画布 > textarea {
    position: absolute;
    display: none;
    top: 0;
    left: 0;
    resize: both;
    border-radius: 4px;
    box-shadow: var(--shadow1);
    background-color: var(--bg1);
    outline: none;
    border: none;
}
.handle {
    width: 16px;
    height: 16px;
    position: absolute;
    left: -20px;
    top: 0;
    opacity: 0;
    transition: var(--transition);
}
x-md {
    min-width: 0.5rem;
    min-height: 0.5rem;
    outline: none;
    word-wrap: break-word;
}
x-md *:hover > .handle {
    opacity: 1;
}
p {
    margin: 0;
}

@font-face {
    font-family: mathfont;
    src: url("../assets/fonts/latinmodern-math.otf");
}

@font-face {
    font-family: misansl3;
    src: url("../assets/fonts/MiSans L3.otf");
}

math {
    font-family: mathfont;
}

mjx-container svg {
    display: inline;
}

mjx-container[jax="SVG"] {
    direction: ltr;
}

mjx-container[jax="SVG"] > svg {
    overflow: visible;
    min-height: 1px;
    min-width: 1px;
}

mjx-container[jax="SVG"] > svg a {
    fill: blue;
    stroke: blue;
}

mjx-assistive-mml {
    position: absolute !important;
    top: 0px;
    left: 0px;
    clip: rect(1px, 1px, 1px, 1px);
    padding: 1px 0px 0px 0px !important;
    border: 0px !important;
    display: block !important;
    width: auto !important;
    overflow: hidden !important;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

mjx-assistive-mml[display="block"] {
    width: 100% !important;
}

mjx-container[jax="SVG"][display="true"] {
    display: block;
    text-align: center;
    margin: 1em 0;
}

mjx-container[jax="SVG"][display="true"][width="full"] {
    display: flex;
}

mjx-container[jax="SVG"][justify="left"] {
    text-align: left;
}

mjx-container[jax="SVG"][justify="right"] {
    text-align: right;
}

g[data-mml-node="merror"] > g {
    fill: red;
    stroke: red;
}

g[data-mml-node="merror"] > rect[data-background] {
    fill: yellow;
    stroke: none;
}

g[data-mml-node="mtable"] > line[data-line],
svg[data-table] > g > line[data-line] {
    stroke-width: 70px;
    fill: none;
}

g[data-mml-node="mtable"] > rect[data-frame],
svg[data-table] > g > rect[data-frame] {
    stroke-width: 70px;
    fill: none;
}

g[data-mml-node="mtable"] > .mjx-dashed,
svg[data-table] > g > .mjx-dashed {
    stroke-dasharray: 140;
}

g[data-mml-node="mtable"] > .mjx-dotted,
svg[data-table] > g > .mjx-dotted {
    stroke-linecap: round;
    stroke-dasharray: 0, 140;
}

g[data-mml-node="mtable"] > g > svg {
    overflow: visible;
}

g[data-mml-node="maction"][data-toggle] {
    cursor: pointer;
}

foreignObject[data-mjx-xml] {
    font-family: initial;
    line-height: normal;
    overflow: visible;
}

mjx-container[jax="SVG"] path[data-c],
mjx-container[jax="SVG"] use[data-c] {
    stroke-width: 3;
}

.show_md {
    display: inline-block !important;
}

.contains-task-list {
    list-style: none;
    padding-inline-start: 16px;
}

x-draw > div {
    width: 16px;
    height: 16px;
    position: fixed;
    right: 0;
    top: 0;
}

x-pro {
    display: inline-block;
    width: 40px;
    height: 16px;
    overflow: hidden;
    position: relative;
    background-color: var(--bg-color3);
    border-radius: 4px;
}
x-pro > div {
    height: 100%;
    background-color: #000;
}
x-pro > span {
    position: absolute;
    top: 0;
    font-size: 12px;
    height: 16px;
    width: 100%;
    text-align: center;
    mix-blend-mode: difference;
    color: #fff;
}

.file > div {
    width: 64px;
    height: 64px;
}

.file > div > .icon {
    width: 64px;
    height: 64px;
}

x-draw {
    display: block;
    pointer-events: all;
}
x-draw > svg:nth-child(2) {
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
}

x-record {
    display: flex;
}
x-record > input {
    appearance: none;
    width: 16px;
    height: 16px;
    background-color: #f00;
    border-radius: 4px;
    transition: var(--transition);
}
.recording {
    border-radius: 8px;
}
x-record > audio {
    height: 16px;
}

x-file {
    display: block;
    width: 100%;
    height: 100%;
}
x-file > div {
    width: 100%;
    height: 100%;
}
x-file > div > * {
    width: 100%;
    height: 100%;
}

x-pdf {
    position: relative;
}
x-pdf > div > div {
    background-color: var(--bg-color2);
    backdrop-filter: var(--blur);
    border-radius: 4px;
    box-shadow: var(--shadow1);
}
x-pdf > div:nth-child(1) {
    display: flex;
    gap: 4px;
    position: absolute;
    z-index: 3;
}
#画布 x-pdf > div:nth-child(1) {
    transform: scale(calc(1 / var(--zoom)));
    transform-origin: left top;
}
x-pdf > div:nth-child(1) > div {
    width: 16px;
    height: 16px;
}
x-pdf > div:nth-child(1) > div:nth-child(2) {
    width: 128px;
    height: 16px;
    position: relative;
}
x-pdf > div:nth-child(1) > div:nth-child(2) > div:nth-child(1) {
    @apply flex items-center justify-center text-xs;
}
x-pdf > div:nth-child(1) > div:nth-child(2) > #pages {
    position: absolute;
    top: 20px;
    height: 256px;
    width: 100%;
    overflow-y: scroll;
    transition: var(--transition);
}
.hide_pdf_pages {
    @apply opacity-0 pointer-events-none;
}
x-pdf > div:nth-child(1) > div:nth-child(2) > div > div {
    @apply relative;
}
x-pdf > div:nth-child(1) > div:nth-child(2) > div > div > span {
    @apply absolute bottom-0 right-0;
}
x-pdf > div:nth-child(1) > div:nth-child(2) > div > div > canvas {
    @apply w-full;
}
x-pdf > canvas {
    width: 100% !important;
    height: 100% !important;
    position: relative;
}
x-pdf > canvas:nth-of-type(2) {
    top: -100%;
}

x-pdf > div:nth-child(4) {
    position: absolute;
    top: 0;
    z-index: 3;
    transform-origin: 0% 0%;
}

x-pdf > div:nth-child(4) > span {
    position: absolute;
    white-space: nowrap;
    color: transparent;
    transform-origin: 0% 0%;
}
x-pdf > div:nth-child(4) > span::selection {
    color: transparent;
    background-color: #0000ff55;
}
x-pdf input {
    text-align: right;
}
x-pdf #page_i::before {
    content: "/";
}

x-img {
    @apply block relative;
}
x-img > img {
    @apply w-full h-full;
}
x-img:hover > div {
    opacity: 1;
    pointer-events: all;
}
x-img > div {
    position: absolute;
    transform: scale(calc(1 / var(--zoom)));
    transform-origin: left top;
    width: 16px;
    height: 16px;
    top: 0;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    background-color: var(--bg-color2);
    backdrop-filter: var(--blur);
    border-radius: 4px;
    box-shadow: var(--shadow1);
}
x-img > div > .icon {
    width: 16px;
    height: 16px;
}

x-progress {
    @apply overflow-hidden;
}
x-progress > div {
    @apply h-full;
}

x-graph {
    @apply relative block w-full h-full;
}
x-graph > #t_md {
    @apply absolute left-0 top-0 z-10 flex gap-1 opacity-0;
    transform: scale(calc(1 / var(--zoom)));
    transform-origin: left top;
    transition: opacity var(--transition);
}
x-graph:hover > #t_md {
    @apply opacity-100;
}
x-graph > #t_md > div {
    @apply bar;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    box-shadow: var(--shadow1);
}
x-graph > div:not(#t_md) {
    @apply w-full h-full;
}

x-graph > textarea {
    @apply absolute top-full bar resize;
    border-radius: 4px;
    box-shadow: var(--shadow1);
}
.hide_jxg_text {
    display: none;
}

x-ggb {
    @apply block relative;
}
x-ggb > .ggb_bar {
    background-color: var(--bg-color2);
    backdrop-filter: var(--blur);
    border-radius: 4px;
    box-shadow: var(--shadow1);
    display: flex;
    position: absolute;
    top: 0;
    height: 16px;
    width: 16px;
    gap: 4px;
    z-index: 3;
    transform: scale(calc(1 / var(--zoom)));
    transform-origin: left top;
}
.ggb_bar > div {
    min-width: 16px;
    height: 16px;
    @apply relative;
}
x-ggb > :not(.ggb_bar) {
    @apply absolute z-0;
}

x-audio {
    @apply flex items-center gap-1;
    background-color: var(--bg-color2);
    backdrop-filter: var(--blur);
    border-radius: 4px;
}
.audio_button {
    @apply relative w-6 h-6 flex-shrink-0;
}
.audio_button > .icon {
    @apply w-6 h-6;
}

.audio_jd {
    @apply h-1 flex-shrink-0 rounded-full overflow-hidden flex-grow;
    transition: var(--transition);
    background-color: var(--bg-color3);
}
.audio_jd > div {
    height: 100%;
    width: 0;
    @apply rounded-full;
    background-color: var(--color6);
}
.audio_yl {
    @apply flex items-center;
}
.audio_yl:hover > :nth-child(1) {
    width: 48px !important;
}
.audio_yl > :nth-child(2) {
    @apply relative w-6 h-6 flex-shrink-0;
}
.audio_yl > :nth-child(2) > .icon {
    @apply w-6 h-6;
}
.audio_yl > :nth-child(1) {
    width: 0;
    @apply rounded-full h-1 overflow-hidden;
    transition: var(--transition);
    background-color: var(--bg-color3);
}
.audio_yl > :nth-child(1) > div {
    width: 100%;
    height: 100%;
    @apply rounded-full;
    background-color: var(--color6);
}
.asr {
    @apply relative w-6 h-6;
}

x-calendar {
    @apply flex flex-col h-full;
    min-height: calc(7 * 1.5rem);
    min-width: calc(7 * 1.5rem);
    background-color: var(--bg-color2);
    backdrop-filter: var(--blur);
    border-radius: 4px;
}
.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    flex-grow: 1;
    justify-items: center;
    align-items: center;
    background-color: var(--bg-color2);
    backdrop-filter: var(--blur);
    border-radius: 4px;
}
.calendar_bar {
    @apply flex w-full justify-between;
}
.calendar_bar > :first-child,
.calendar_bar > :last-child {
    @apply w-6 h-6 relative;
}
.calendar > * {
    @apply text-center align-middle opacity-60 w-6 h-6 rounded relative;
}
.calendar_schedule {
    @apply w-full flex justify-center absolute bottom-0;
}
.calendar_schedule > div {
    @apply w-1 h-1 rounded-full bg-current;
}
.calendar_week {
    opacity: 1 !important;
}
.calendar_month {
    opacity: 1 !important;
}
.calendar_today {
    background-color: var(--color6);
    color: var(--color5);
}

time-b {
    @apply flex;
}
time-b > input {
    width: 2ch;
    text-align: center;
}

x-time {
    @apply flex items-center;
    background-color: var(--bg-color2);
    backdrop-filter: var(--blur);
    border-radius: 4px;
}
x-time > :nth-child(2) {
    @apply flex items-center flex-grow overflow-hidden;
}
x-time input[type="checkbox"] {
    @apply checkbox;
}

x-time > :nth-child(2) > div {
    @apply flex items-center;
}
.time_play {
    @apply w-8 h-8 relative flex-shrink-0;
}
.time_jdt {
    @apply h-8 relative rounded overflow-hidden;
}

.time_jdt > :nth-child(1) {
    @apply absolute m-1 mix-blend-difference text-white z-10;
}
.time_jdt > x-progress {
    @apply absolute left-0 rounded m-1 pointer-events-none;
    height: calc(2rem - 0.25rem * 2);
    width: calc(100% - 0.25rem * 2);
    background-color: var(--bg-color3);
}
.time_jdt > x-progress > div {
    @apply rounded;
    background-color: var(--color6);
}
.x-time > :nth-child(2) {
    @apply w-0 flex-grow-0;
}
.x-time > .time_jdt {
    @apply flex-grow;
}
.x-time:hover > :nth-child(2) {
    @apply flex-grow;
}
.x-time:hover > .time_jdt {
    @apply flex-grow-0;
}

x-link {
    @apply cursor-pointer;
}

x-zi {
    @apply inline-block;
}
x-zi > img {
    @apply h-4;
    filter: var(--icon-color);
}

@media (any-pointer: coarse) {
    :root {
        --icon-p-b-size: 48px;
        --icon-size: 28px;
        --icon-margin: 10px;
        --item-height: 36px;
        --item-icon: 24px;
        --item-icon-margin: 6px;
        --x-x-handle-w: 16px;
        --x-x-bar-w: 20px;
    }
    .icon-m {
        @apply h-12 w-12 relative !important;
    }
    .icon-m > .icon {
        @apply h-8 w-8 top-2 left-2 !important;
    }
    #导航 > div {
        @apply w-6 h-6 !important;
    }
    #导航 > div > .icon {
        @apply w-6 h-6 !important;
    }
    x-sinppet > div > img {
        padding: 8px;
    }
}

@media screen and (max-width: 420px) {
    x-graph > div:not(#t_md) {
        width: 300px;
        height: 300px;
    }
}

@media all and (orientation: portrait) {
    body > #main {
        grid-template-rows: auto min-content;
    }
    body > #main > #nav {
        grid-area: 2 / 1 / 3 / 2;
        grid-template-columns: 144px auto;
    }
    body > #main > #nav > :nth-child(1) {
        grid-area: 2 / 1 / 3 / 3;
    }
    body > #main > #nav > #mode_bar {
        grid-area: 1 / 1 / 2 / 2;
    }
    body > #main > #nav > .mode_more {
        grid-area: 1 / 2 / 2 / 3;
    }
    body > #main > #nav #切换侧栏 {
        transform: rotate(-90deg);
        display: block;
    }
    body > #main > #画布 {
        grid-area: 1 / 1 / 2 / 2;
    }
    .侧栏 {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        position: fixed;
        left: 0;
        top: calc(100dvh * (1 / 3));
        height: calc(100dvh * (2 / 3));
        width: 100vw;
        transform: translateY(100%);
        border-radius: 32px 32px 0 0;
        box-shadow: none;
    }
    .侧栏显示 {
        transform: translateY(0%);
    }
    .侧栏 > #items {
        width: 100%;
    }
    .侧栏 > #items > * {
        width: 100%;
    }
    .item_hide {
        width: 100% !important;
    }
    .侧栏 > #handle > div {
        width: 32px;
        height: 4px;
        margin: 8px auto;
        background-color: var(--bg-color3);
        border-radius: 2px;
    }
    .侧栏 > #tabs {
        width: 100%;
        flex-direction: row;
        flex-shrink: 0;
        overflow: auto;
    }
    .selected_item_hide {
        background-color: var(--bg-color1);
    }
    #层handle {
        @apply w-full;
        min-height: 4px;
        background-color: var(--bg-color3);
    }
    .层hide {
        @apply hidden;
    }

    x-color {
        top: auto;
        bottom: var(--icon-p-b-size);
    }
    #笔 > div {
        top: auto;
        bottom: var(--icon-p-b-size);
    }

    .breadcrumbs {
        top: 0;
        left: 0;
        width: 100vw;
    }
    body > #搜索 {
        position: absolute;
        top: 16px;
        left: 16px;
        width: calc(100vw - 16px * 2);
    }
    body > #搜索 > #搜索结果 {
        max-height: 40vh;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color1: rgba(100, 100, 100, 0.8);
        --bg-color2: rgba(0, 0, 0, 0.72);
        --bg-color3: #222;
        --bg-color4: #161616;
        --bg-color5: rgba(119, 119, 119, 0.2);
        --color5: #111;
        --color6: #fff;
        --shadow1: 0 0 4px #ccc6;
        --bg1: #000000;
        --icon-color: invert(1) !important;
    }
}
